package com.imooc.aop.service;

import com.imooc.aop.security.CurrentUserHolder;
import org.springframework.stereotype.Component;

/**
 * @ClassName AuthService
 * @Description TODO
 * @Author Wxg
 * @Date 2018/11/14 13:09
 * @Version 1.0
 */
@Component
public class AuthService {

    public void checkAccess() {
        String user = CurrentUserHolder.get();
        if (!"admin".equals(user)) {
            throw new RuntimeException("operation not allow");
        }
    }
}
